package com.derek.omshopping.ui.classify;

import android.util.Log;

import com.derek.omshopping.bean.classify.ClassifyLeftListViewBean;

import java.util.List;

/**
 * Created by My on 2016/10/17.
 */

public class ClassifyPresenter implements ClassifyContract.Presenter {
    private ClassifyContract.View view;
    private ClassifyContract.Model model;
    public ClassifyPresenter(ClassifyContract.View view){
        this.view=view;
        model=new ClassifyModel();
    }

    @Override
    public void getLeftTypeFromNet() {
        model.getListView(new ClassifyModel.onGetListViewUrlListener() {
            @Override
            public void LoadListViewUrl(List<ClassifyLeftListViewBean> list_left,List<String> code_mgroupAll) {
                if(list_left!=null){
                    view.onListViewSuccess(list_left,code_mgroupAll);
                    Log.i("tag","下载成功");
                }else{
                    view.onListViewFail("下载失败");
                    Log.i("tag","下载失败");
                }
            }
        });
    }

}
